learn how to calculate safe days